package com.shanzmoo.db.sys.entity.dto;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.sys.entity.OutletInfoEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 门店信息修改对象
 * @author Gzhao
 * @date 2020/12/12
 */
@Data
@ApiModel("门店信息修改对象")
public class OutletInfoUpdateDto extends OutletInfoSaveDto {

    private static final long serialVersionUID = 1758L;

    @NotNull(message = "门店ID不允许为空")
    @ApiModelProperty("门店ID" )
    private Integer id;

    @Override
    public OutletInfoEntity convert(Integer userId) {
        OutletInfoEntity outletInfoEntity = JSON.parseObject(JSON.toJSONString(this), OutletInfoEntity.class);
        outletInfoEntity.setUpdateUser(userId);

        return outletInfoEntity;
    }
}
